﻿<UserControl x:Class="MyFinanceManager.PC.ucNewViewFuelRecord"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:wpfToolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
       xmlns:app="clr-namespace:MyFinanceManager.PC"
     MinHeight="300" MinWidth="300">
    <UserControl.Resources>
        <DataTemplate x:Key="FuelTemplate">
            <Grid Width="150">
                <Rectangle Fill="{x:Null}" Stroke="White">
                    <Rectangle.BitmapEffect>
                        <OuterGlowBitmapEffect GlowColor="White" />
                    </Rectangle.BitmapEffect>
                </Rectangle>
                <StackPanel Margin="3,3,3,3">
                    <WrapPanel>
                        <TextBlock Text="{Binding Path=Time.DayOfWeek, Mode=OneWay}"  />
  				        <TextBlock Text=" "  />
  				        <TextBlock Text="{Binding Path=Time.Day, Mode=OneWay}"  />
  				        <TextBlock Text="."  />
  				        <TextBlock Text="{Binding Path=Time.Month, Mode=OneWay}"  />
  				        <TextBlock Text="."  />
  				        <TextBlock Text="{Binding Path=Time.Year, Mode=OneWay}"  />
  				        <TextBlock Text=" "  />
  				        <TextBlock Text="{Binding Path=Time.Hour, Mode=OneWay}"  />
  				        <TextBlock Text=":"  />
  				        <TextBlock Text="{Binding Path=Time.Minute, Mode=OneWay}"  />
  			      </WrapPanel>
                    <TextBlock Text="{Binding Path=Amount, StringFormat=C}" TextAlignment="Center" HorizontalAlignment="Stretch"/>
               </StackPanel>
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="160"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <ListBox x:Name="itemsArea"  ItemTemplate="{DynamicResource FuelTemplate}" IsSynchronizedWithCurrentItem="True" Background="#3EFFFFFF" SelectionChanged="ListBox_SelectionChanged"/>
        <StackPanel Grid.Column="1" Margin="8,8,8,8">
            <StackPanel x:Name="contentArea">
                <TextBlock Text="Tankstelle" />
		    <TextBox Text="{Binding Path=Fuelstation, Mode=Default}"/>
            <TextBlock Text="Betrag" />
		     <TextBox Text="{Binding Path=Amount, StringFormat=C, Mode=Default}"/>
            <TextBlock Text="Benzinpreis" />
		     <TextBox Text="{Binding Path=Gasprice, StringFormat=N3, Mode=Default}"/>
            <TextBlock Text="Benzinmenge" />
		     <TextBox Text="{Binding Path=AmountOfGas, StringFormat=N2, Mode=Default}"/>
            <TextBlock Text="Kilometerstand" />
		     <TextBox Text="{Binding Path=Mileage, StringFormat=000000, Mode=Default}"/>
            <TextBlock Text="Datum" />
            <wpfToolkit:Calendar x:Name="calender" SelectedDate="{Binding Path=Time, Mode=Default}" SelectionMode="SingleDate" IsTodayHighlighted="False"/>
        </StackPanel>
            <Grid MaxWidth="400">
                <Rectangle Fill="#7FFFFFFF" Stroke="#FF9B1919" RadiusX="31.5" RadiusY="31.5" StrokeThickness="5">
                    <Rectangle.BitmapEffect>
                        <OuterGlowBitmapEffect GlowColor="#FF9B1919"/>
                    </Rectangle.BitmapEffect>
                </Rectangle>
                <app:ucAddNewFuel x:Name="NewPosting" Margin="30,30,30,30"/>
                <Grid VerticalAlignment="Bottom"  Margin="130,30,130,30" Height="40" >
                    <Button Content="hinzufügen" Click="AddNewPosting_Click"/>
                </Grid>
            </Grid>
        </StackPanel>
    </Grid>
</UserControl>
